home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5356 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1015 b   |  40 lines

  1. Path: hamlet.uncg.edu!q_zhong
  2. From: "QIAN . ZHONG" <q_zhong@hamlet.uncg.edu>
  3. Newsgroups: comp.lang.c++
  4. Subject: pInt = new int [987654321L], what will happen ?
  5. Date: Sat, 3 Feb 1996 22:06:07 -0500
  6. Organization: The University of North Carolina at Greensboro
  7. Message-ID: <Pine.SOL.3.91.960203215559.25805E-100000@hamlet.uncg.edu>
  8. NNTP-Posting-Host: hamlet.uncg.edu
  9. Mime-Version: 1.0
  10. Content-Type: TEXT/PLAIN; charset=US-ASCII
  11.  
  12.  
  13. Hi, folks:
  14.  
  15. Here is a question about new, the following is my code:
  16.  
  17. int main(void)
  18. {
  19.     int *pInt;
  20.     long Block = 987654321L;
  21.  
  22.     pInt = new int[Block];
  23.     if(pInt == NULL) dosomething();
  24. }
  25.  
  26. My problem is when I compile the program for DOS under large memory 
  27. model, above new nerve return NULL, I guess compiler convert
  28.  
  29. new int[987654321L] --- convert --> new int[ ACONST]
  30. where ACONST = 0xffff , or ACONST = 0x7fff, am I right ?
  31. Is this a DOS thing ? or a C++ thing ? Is this portable ?
  32.  
  33.  
  34.  Qian Zhong
  35.  Department of Chemistry.
  36.  UNC, Greensboro
  37.  Email: q_zhong@hamlet.uncg.edu
  38.  
  39.  
  40.